﻿using System;
using System.ComponentModel;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using Microsoft.SharePoint;
using Microsoft.SharePoint.WebControls;
using System.Web.UI.HtmlControls;

namespace OARepository.ListItemHeader
{
    [ToolboxItemAttribute(false)]
    public class ListItemHeader : WebPart
    {
        protected override void CreateChildControls()
        {
        }
        protected override void OnLoad(EventArgs e)
        {
            SPItem item = SPContext.Current.Item;
            try
            {
                HtmlMeta meta = new HtmlMeta();
                meta.Name = "DC.title";
                meta.Content = item["Title"].ToString();
                Page.Header.Controls.Add(meta);
            }
            catch (NullReferenceException)
            {
            }
        }
    }
}
